<template>
  <div class="edit_data">
    <!-- 顶部导航栏 -->
    <head-nav-bar>
      <template #left>
        <div class="head_name" @click="back">
          <img
            class="return"
            src="https://www.hualigs.cn/image/60408d2367fba.jpg"
            alt=""
          />
          <span class="return_">返回</span>
        </div>
      </template>
      <template #center>
        <div class="head_name2">通用设置</div>
      </template>
    </head-nav-bar>
    <div class="kongbai"></div>
    <!-- 中间内容区 -->
    <div class="content">
      <div class="born atn">
        <span class="nicheng">新消息提醒</span>
        <span class="jieshao">开/关</span>
      </div>
      <div class="line_"></div>
      <div class="sex atn">
        <span class="nicheng">关于我们</span>

        <img class="mkl" src="../images/left.png" alt="" />
      </div>
    </div>
  </div>
</template>
<script>
import HeadNavBar from "../../../components/HeadNavBar";
export default {
  data() {
    return {};
  },
  components: {
    HeadNavBar
  },
  sockets: {
    receiveMsg(data) {
      console.log(data);
      let datas = this.$store.state.userinfo.userList;
      // console.log(datas);
      var flag = true;
      if (datas.length === 0) {
        this.$store.commit("setuserList", data);
      } else {
        for (let i = 0; i < datas.length; i++) {
          // console.log(datas[i]);
          if (datas[i].userid === data.userid) {
            datas[i].content = data.content;
            // console.log("第二次发");
            flag = false;
            break;
          }
        }
        if (flag === true) {
          this.$store.commit("setuserList", data);
          // console.log("第一次发");
        }
      }
    },
  },
  methods: {
    back() {
      this.$router.go(-1); //返回上一层
    }
  }
};
</script>
<style scoped>
.edit_data {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background-color: #f3f3f3;
}
.head_name {
  position: absolute;
  height: 25px;
  width: 60px;
  line-height: 25px;
}
.return {
  position: absolute;
  top: 2px;
  height: 21px;
  width: 21px;
}
.return_ {
  position: absolute;

  top: 0;
  left: 22px;
  height: 25px;
  line-height: 25px;
}
.head_name2 {
  margin: 0 auto;
}
.kongbai {
  height: 20px;
}
.content {
  height: 108px;
  background-color: #ffffff;
  border-bottom: 1px solid #cccccc;
  border-top: 1px solid #cccccc;
  padding: 0 10px 0 20px;
  font-size: 14px;
}

.atn {
  width: 100%;
  height: 50px;
  position: relative;
  background: #ffffff;
}
.ert {
  height: 70px;
  line-height: 70px;
}


.nicheng {
  line-height: 50px;
}
.jieshao {
  line-height: 50px;
  position: absolute;
  right: 10px;
  font-size: 12px;
  color: #969696;
}
.mkl {
  height: 20px;
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
}

.line_ {
  width: 100%;
  height: 1px;
  background-color: #cccccc;
  margin: 0 auto;
}

</style>
